Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for passing function generating line numbers in editor options #10

Merged
merged 1 commit into from
Nov 11, 2021

Conversation

wkordalski
Copy link
Contributor

Monaco editor allows for passing functions to line_numebers editor option.

rust-monaco/ts2rs/monaco.d.ts

Lines 3521 to 3526 in 1412b80

export type LineNumbersType =
| "on"
| "off"
| "relative"
| "interval"
| ((lineNumber: number) => string);

Unfortunatelly, it is translated to Rust in a wrong way:

str_enum! {
pub enum LineNumbersType {
On = "on",
Off = "off",
Relative = "relative",
Interval = "interval",
LineNumberNumberString = "(lineNumber: number) => string",
}
}

I've expanded the macros and implemented LineNumbersType so that is accepts also js_sys::Function

@siku2 siku2 merged commit 37f4404 into siku2:master Nov 11, 2021
@wkordalski wkordalski deleted the line-number-option-as-function branch November 11, 2021 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants